package ImplicitInvocationVersion;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Observable;

public class Lines extends Observable{
	
private List<String> lines;
	
	public Lines(){
		lines=new ArrayList<String>();
	}
	
	public void printLines(){
		Iterator<String> itor=lines.iterator();
		while(itor.hasNext()){
			String line=itor.next();
			System.out.println(line);
		}
	}
	
	public void addLine(String line){
		lines.add(line);
		setChanged();
		notifyObservers(line);
	}
	
	public String getLine(int i){
		return lines.get(i);
	}
	
	public int count(){
		return lines.size();
	}

	public List<String> getList(){
		return lines;
	}
}
